<?php
/**
 * 后台首页集成
 */
namespace Admin\Controller;

class IndexController extends CommonController {
    /*
     * 构造函数
     *
     * @return  #
     */
    public function _initialize(){       
        parent::_initialize(); 
        $_REQUEST['listRows']  =100;
        $this->db   =D("Node");       
    }
    
    /*
     * 获取节点列表
     * 
     * @return  #
     */
    public function index(){
        $map    =$this->_search("Node");
        /*获取节点列表 start*/
        if(session('type')==3){ //开发者/超级管理员
            $map['use_level']   =array("egt",1);
        }elseif(session("type")==2){
            $map['use_level']   =array('egt',2);
        }else{
            $map['use_level']   =3;
        }        
        //获取顶级节点
        $map['level']   =0;
        $map['state']   =1;
        $oneLevelList   =$this->_list($this->db,$map,'ord',TRUE);        
        //获取次级节点列表
        $map['level']   =1;       
        $twoLevelList   =$this->_list($this->db,$map,"ord",TRUE);
        /*获取节点列表 end*/
        $this->assign("oneLevelList",$oneLevelList);
        $this->assign("twoLevelList",$twoLevelList);
        $this->display();
    }
}